'\" t
.TH "PORT\-MIRROR" "1" "2\&.6\&.99" "MacPorts 2\&.6\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
port-mirror \- Fetch distfiles for a port
.SH "SYNOPSIS"
.sp
.nf
\fBport\fR [\fB\-qvdp\fR] [\fB\-D\fR \fIportdir\fR] \fBmirror\fR
     [\-\-new]
     [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
.fi
.SH "DESCRIPTION"
.sp
\fBport mirror\fR creates or updates a local mirror of source archives (called \fIdistfiles\fR in MacPorts lingo) for the ports given on the command line\&. It will download any file that can be fetched using the standard \fBlibcurl\fR(3) download method and ignore ports that fetch from version control systems such as Subversion or Git\&.
.sp
Downloaded files will be checked for consistency and deleted if the checksums don\(cqt match those specified in the \fIPortfile\fR\&. Additionally, successfully downloaded files are stored in a custom database in \fI$portdbpath/distfiles_mirror\&.db\fR, where \fI$portdbpath\fR can be configured in \fBmacports.conf\fR(5)\&. This database can be deleted and re\-created from scratch using the \fB\-\-new\fR option\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
Ports that have NoMirror in their license field will not be mirrored\&.
.sp .5v
.RE
.SH "OPTIONS"
.PP
\fB\-\-new\fR
.RS 4
Delete the existing database of mirrored files and re\-create it from scratch\&.
.RE
.SH "GLOBAL OPTIONS"
.sp
Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
.PP
\fB\-p\fR
.RS 4
Don\(cqt abort downloading on the first error\&. This can be useful when attempting to create or update a full mirror, e\&.g\&. when using
\fBport mirror all\fR\&.
.RE
.SH "EXAMPLES"
.sp
If your use case for \fBport mirror\fR is downloading the files you need to install a set of ports later without a network connection, do not use \fBport mirror\fR: It will not work for ports that distribute their source code using a version control system such as Subversion or Git\&. Instead, use \fBport fetch\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
$> sudo port \-p fetch rdepof:$newport and not installed
$> sudo port \-p fetch $newport
.fi
.if n \{\
.RE
.\}
.sp
These can also be conveniently wrapped in a single command using a port expression (see \fBport\fR(1) for details):
.sp
.if n \{\
.RS 4
.\}
.nf
$> sudo port \-p fetch $newport rdepof:$newport and not installed
.fi
.if n \{\
.RE
.\}
.sp
If your intention is creating a new complete mirror of all MacPorts distfiles, it is probably easier to sync them via rsync from our main mirror\&. See \m[blue]\fBMirrors\fR\m[]\&\s-2\u[1]\d\s+2 for details\&.
.sp
If you want to create a partial mirror of MacPorts distfiles or are running the main mirror for MacPorts, you should use \fBport mirror\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
$> sudo port \-p mirror all
$> sudo port \-p mirror maintainer:^cal or category:haskell
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp
\fBport\fR(1), \fBport-fetch\fR(1), \fBlibcurl\fR(3), \fBcurl\fR(1)
.SH "AUTHORS"
.sp
.if n \{\
.RS 4
.\}
.nf
(C) 2014 The MacPorts Project
Clemens Lang <cal@macports\&.org>
.fi
.if n \{\
.RE
.\}
.SH "EXTERNAL REFERENCES"
.IP " 1." 4
Mirrors
.RS 4
\%https://trac.macports.org/wiki/Mirrors
.RE
